package com.job.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.job.common.ResponseResult;
import com.job.common.exception.ParameterIsNullException;
import com.job.controller.req.PositionSearchVO;
import com.job.service.PositionService;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@Api("首页")
@RestController
@RequestMapping("/index")
public class IndexController {

    @Resource
    private PositionService positionService;

    @GetMapping("/search")
    public ResponseResult<IPage<Map<String,Object>>> indexSearch(@Validated PositionSearchVO search)
            throws ParameterIsNullException {
        return positionService.positionSearch(search);
    }

}
